-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ghc: apply a patch to fix common gold linker problem #27584
Conversation
@domenkozar, thanks for your PR! By analyzing the history of the files in this pull request, we identified @dtzWill, @peti and @3noch to be potential reviewers. |
LGTM but I'm no expert here :) |
Yes, this looks right to me as well. |
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec { | |||
sha256 = "1c8qc4fhkycynk4g1f9hvk53dj6a1vvqi6bklqznns6hw59m8qhi"; | |||
}; | |||
|
|||
patches = [] | |||
patches = [ ./ghc-gold-liner.patch ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be gold-linker
or is this a clever pun?
It would otherwise result into undefined referenecs for some functions in the base when using the gold linker: error: undefined reference to 'sqrt' Fixes haskell/double-conversion#17 Previously ghc option -optl=-lm was used for packages depending on such functions, but that could result into fatal error: cannot mix -r with dynamic object /nix/store/7crrmih8c52r8fbnqb933dxrsp44md93-glibc-2.25/lib/libm.so.6 in some situations like profiling builds. Patch was prepared by Michael Bishop and Niklas Hambüchen
Tracked as GHC #14022. Patch uploaded as D3780. Thanks for reporting this! |
62781b3
to
1715844
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@peti should we merge this or are you going to incorporate into your fork? |
I've added it to |
@peti could you also backport to 17.03? Thank you! |
It would otherwise result into undefined referenecs for some functions in the base when using the gold linker: error: undefined reference to 'sqrt' Fixes haskell/double-conversion#17 Previously ghc option -optl=-lm was used for packages depending on such functions, but that could result into fatal error: cannot mix -r with dynamic object /nix/store/7crrmih8c52r8fbnqb933dxrsp44md93-glibc-2.25/lib/libm.so.6 in some situations like profiling builds. Patch was prepared by Michael Bishop and Niklas Hambüchen. Closes #27584. (cherry picked from commit aafe3d2)
@peti I don't want to hit "Delete branch" for you, in case you need the branch still. If not, could you? :D |
For the record, GHC upstream is taking a slightly different tack on this: https://phabricator.haskell.org/D3787. |
It would otherwise result into undefined referenecs for some functions in the base when using the gold linker: error: undefined reference to 'sqrt' Fixes haskell/double-conversion#17 Previously ghc option -optl=-lm was used for packages depending on such functions, but that could result into fatal error: cannot mix -r with dynamic object /nix/store/7crrmih8c52r8fbnqb933dxrsp44md93-glibc-2.25/lib/libm.so.6 in some situations like profiling builds. Patch was prepared by Michael Bishop and Niklas Hambüchen. Closes NixOS#27584. (cherry picked from commit aafe3d2)
It would otherwise result into undefined referenecs for some functions
in the base when using the gold linker:
error: undefined reference to 'sqrt'
Fixes haskell/double-conversion#17
Previously ghc option -optl=-lm was used for packages depending on
such functions, but that could result into
fatal error: cannot mix -r with dynamic object /nix/store/7crrmih8c52r8fbnqb933dxrsp44md93-glibc-2.25/lib/libm.so.6
in some situations like profiling builds.
Patch was prepared by Michael Bishop and Niklas Hambüchen
NOTE: this hasn't been tested on macOS yet.
cc @peti